Skip to content

Keystone: User Controller#657

Merged
mandre merged 2 commits intok-orc:mainfrom
dlaw4608:keystone_user
Mar 4, 2026
Merged

Keystone: User Controller#657
mandre merged 2 commits intok-orc:mainfrom
dlaw4608:keystone_user

Conversation

@dlaw4608
Copy link
Contributor

Fixes #583
Add Support for the Identity service's User resource in ORC

@github-actions github-actions bot added the semver:major Breaking change label Jan 28, 2026
@dlaw4608 dlaw4608 force-pushed the keystone_user branch 2 times, most recently from 23295c5 to dcfe645 Compare January 29, 2026 19:28
@dlaw4608 dlaw4608 marked this pull request as ready for review January 29, 2026 19:32
Copy link
Contributor

@winiciusallan winiciusallan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @dlaw4608, that was a great job!

Left a few comments about using a Project object instead of the ID directly, LMK what you think.

// +kubebuilder:validation:MinLength:=1
// +kubebuilder:validation:MaxLength:=255
// +optional
DefaultProjectID *string `json:"defaultProjectID,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it better to use a ProjectRef here so we can better control the resource?

Suggested change
DefaultProjectID *string `json:"defaultProjectID,omitempty"`
DefaultProjectID *ProjectRef `json:"defaultProjectID,omitempty"`

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should indeed be a reference, but would rather be in the form:

Suggested change
DefaultProjectID *string `json:"defaultProjectID,omitempty"`
DefaultProjectRef *KubernetesNameRef `json:"defaultProjectRef,omitempty"`

See https://k-orc.cloud/development/architecture/#api-design-philosophy.

I'd like to add a lint rule to flag these.

Also, since this is an optional dependency for your controller, you should have run the scaffolding tool with -optional-create-dependency Project.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, went back and recreated the user controller this time with Project included as an optional dependency
go run ./cmd/scaffold-controller -interactive=false \ -kind User \ -gophercloud-client NewIdentityV3 \ -gophercloud-module github.com/gophercloud/gophercloud/v2/openstack/identity/v3/users \ -import-dependency Domain \ -optional-create-dependency Domain \ -optional-create-dependency Project

Changed ProjectRef to DefaultProjectRef to match the OpenStack field naming. The spec only references other ORC objects (like Project) by K8s name, never OpenStack UUIDs. The controller resolves the reference to get the Project's UUID and waits for the Project to be Available before creating the User with its DefaultProjectID.

}
}

func handleDefaultProjectIDUpdate(updateOpts *users.UpdateOpts, resource *resourceSpecT, osResource *osResourceT) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly change this to use a reference instead of an ID as suggested above.

Comment on lines +29 to +33





Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blank lines at the end. I would remove them to make it cleaner.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack, done

// +kubebuilder:validation:MinLength:=1
// +kubebuilder:validation:MaxLength:=255
// +optional
DefaultProjectID *string `json:"defaultProjectID,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should indeed be a reference, but would rather be in the form:

Suggested change
DefaultProjectID *string `json:"defaultProjectID,omitempty"`
DefaultProjectRef *KubernetesNameRef `json:"defaultProjectRef,omitempty"`

See https://k-orc.cloud/development/architecture/#api-design-philosophy.

I'd like to add a lint rule to flag these.

Also, since this is an optional dependency for your controller, you should have run the scaffolding tool with -optional-create-dependency Project.

// +kubebuilder:validation:MinLength:=1
// +kubebuilder:validation:MaxLength:=255
// +optional
Password *string `json:"password,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This must be stored in a secret. See how we do it for user data in the server controller.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Followed the same structure as user data in the server controller, the user_types api uses a SecretRef field to reference a secret containing the password of a user in a secret, thanks for the help!!

@dlaw4608 dlaw4608 force-pushed the keystone_user branch 4 times, most recently from c2ebe4c to cfe154f Compare February 11, 2026 10:11
Copy link
Collaborator

@mandre mandre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also add the User resource to the README ?

go run ./cmd/scaffold-controller
 -interactive=false \
 -kind User \
 -gophercloud-client NewIdentityV3 \
 -gophercloud-module github.com/gophercloud/gophercloud/v2/openstack/identity/v3/users \
 -import-dependency Domain \
 -optional-create-dependency Domain \
 -optional-create-dependency Project

Signed-off-by: Daniel Lawton <dlawton@redhat.com>
- E2E tests included
- API configured
- Controller

Note: Password functionality will be implemented in a future PR.
Users can still be created and managed, just without password support.

Signed-off-by: Daniel Lawton <dlawton@redhat.com>
@dlaw4608 dlaw4608 marked this pull request as ready for review March 4, 2026 16:11
Copy link
Collaborator

@mandre mandre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, let's get this merged.

@mandre mandre added this pull request to the merge queue Mar 4, 2026
github-merge-queue bot pushed a commit that referenced this pull request Mar 4, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Mar 4, 2026
@mandre mandre added this pull request to the merge queue Mar 4, 2026
Merged via the queue into k-orc:main with commit 21e4081 Mar 4, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver:major Breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keystone User Controller

3 participants